DATA AND CODE README:
----------------------------------�Inequality, Relative Deprivation and Financial Distress - Evidence from Swedish Register Data� (Roth)Note on Data Availability: The information used in the analysis combines several Swedish administrative registers (as described in the paper), which were merged using social security numbers and workplace identifiers. The data use is subject to the European Union�s General Data Protection Regulation (GDPR). The data are physically stored on computers at Statistics Sweden and, due to security considerations, the data may not be transferred to computers outside Statistics Sweden. Researchers interested in obtaining access to the register data employed in this paper are required to submit a written application to gain approval from Statistics Sweden and the Swedish Ethical Review Authority. The application must include a detailed description of the proposed project, its purpose, and its social contribution, as well as a description of the required datasets, variables, and analysis population. Applications can be submitted by researchers who are affiliated with Swedish institutions accepted by Statistics Sweden or by researchers outside of Sweden who collaborate with researchers affiliated with these institutions. For more information see: 
https://www.scb.se/en/services/ordering-data-and-statistics/ordering-microdata/

SOFTWARE: 
----------------------------------
The analyses were carried out in Stata 17. 

REPLICATION: 
----------------------------------
The replication package includes the codes to produce the final data (final_data.dta) and to produce the analyses in the paper (table 3, 4, 5, 6, 7, 8, 9, A4.1, A4.2, A4.3, A4.4, A4.5, A5.1, A5.2, A5.3, A5.4, A5.5, A5.6, A5.7 and figure 1).

FOLDERS: 
----------------------------------

Data/
	raw - contains the raw data delivered from Statistics Sweden 
	use - contains the files used for analyses 
	out - contains figures and tables for paper


The raw folder contains four subfolders, LISA (Income and background variables), IoT (Income and Taxation), HUT (Household Budget Survey) and SEA (Swedish Enforcement Authority), each containing deliveries from separate registers from Statistics Sweden. There is also a dataset with house prices at the municipality-level (houseprices.dta) from Statistics Sweden. The delivery from SEA contains two registries: claims.dta and collection.dta. The claims contains all claims between 2014-2017 and collection all individuals registered for collection at the end of 2017. 

All the registers used for the analyses are described in section 5 in the paper. 

The main outcome variable is claim_dummy which is an indicator for having a registered claim during the year. In the robustness section there is also an alternative outcome called claim_unpaid which is an indicator for receiving a claim that is not repaid and hence registered for debt collection. 

DO-FILES: 
----------------------------------

	1_manage_lisa - cleans and harmonizes raw files from the LISA-register to create final_data.dta 
	2_manage_hut - cleans and harmonizes raw files from the HUT-register to create final_hut.dta
	3_manage_consumption - imputes household consumption 
	4_manage_iot - cleans and harmonizes raw files from the HUT-register to create final_consumption.dta
	5_manage_lisa_for_yitz - cleans and harmonizes raw files from the LISA-register to be used for the yitzhaki estimation 
	6_yitzhaki_all - creates Yitzhaki measures for all different analyses
	7_merge - merges the datasets to create final_data.dta
	8_descriptives - creates tables 3, 4, A4.1
	9_analysis_main - creates the main table (table 5), using final_data.dta
	10_analysis_gender - creates tables (table 6, A4.3, A4.4, A4.5) for the gender analyses
	11_analysis_consumption - creates tables for mechanism section (table 7, 8, A4.6)
	12_analysis_consumption_HUT - creates tables for mechanism section using HUT data (table 7, 9)
	13_analysis_robust - creates tables for robustness section (table A4.2, A5.1, A5.2, A5.3, A5.4, A5.5, A5.6, A5.7)
	14_analysis_yitz_margins - creates figure 1. 

VARIABLES: 
-----------------------------------
name:  			description:
age			age
akupens			pension		
avg_age			average municipality age
avg_kids		average number of children
cdisp			disposable income
CfarNr			work place identifier
claim_dummy		claim indicator
claim_tot		total number of claims
claim_unpaid		unpaid claims indicator
derivatives		derivatives
dispinc			disposable income
dispinc_2lag		disposable income, 2 year lag
dispinch		household disposable income
district		district
early_retirement	early retirement indicator
educ			education attainment in years
female			female indicator
ffors			capital insurance
fnettmv			market value of assets
fskulmv			market value of debt
ismlan 			student loan 
kakurta			interest expense
kf			capital loss
kfbrut			capital loss
kkuvp			interest rate incomekir
kiranta 		interest rate
kids			number of children in the household
kv			capital gain 
kvbrut			capital gain 
lnp20			log(p20), municipality
lnp50			log(p50), municipality
lnp50_agegroup		log(p50), age group
lnp50_cfarnr		log(p50), workplace
lnp50_deso		log(p50), deso
lndispinc		log(dispinc)
lnhouseprice		log(houseprice)
LopNr			individual identifier
married			married dummy 
municipality		municipality
nakte			business income
nakthb			business income
npas			passive business income
npashb			passive business income
nutland			business income from abroad
pchange			price change
percentile		income percentile by year and municipality 
population 		municipality population 
population_agegroup	age group size
population_cfarnr	workplace size
population_deso		DeSo size
selfemployed		selfemployment indicator
share_female		share females
share_loweduc		share with less than high school education 
share_married		marriage rate
share_poor		share poor in municipality
share_selfemployed	share selfemployed in municipality
sick_leave		sick leave indicator
skubank			tax
skimp			tax
soc_ben	receiving 	social benefits indicator
tfoab			business income
uater			repayment of student loan
unemployed		being unemployed during the year
year			year
yitz_agegroup		YRD, age group level 
yitz_cfarnr		YRD, measured at the workplace level
yitz_deso		YRD, DeSO level
yitz_muni		YRD, municipality level
yitz_muni_outliers	YRD, without outliers
yitz_muni_perm		YRD, permanent income	


